package cn.myframe.shiro;

import cn.myframe.entity.sys.SysUserEntity;
import org.apache.shiro.SecurityUtils;

public class ShiroUtils {

    public static SysUserEntity getUserEntity() {
        try{
            return (SysUserEntity)SecurityUtils.getSubject().getPrincipal();
        }catch(Exception e){
            return null;
        }
    }

    public static void logout() {
        SecurityUtils.getSubject().logout();
    }
}
